package edu.gxmzu.task.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import edu.gxmzu.task.mapper.UserMyMessageMapper;
import edu.gxmzu.task.models.UserMyMessageModel;
import edu.gxmzu.task.service.UserMyMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserMyMessageServiceImpl implements UserMyMessageService {
    @Autowired
    private UserMyMessageMapper userMyMessageMapper;


    @Override
    public PageInfo<UserMyMessageModel> getUserMyMessage(int pageNum, int pageSize, String userId, String appointorName,  Long startTime, Long endTime,String title) {

        //开启分页查询
        PageHelper.startPage(pageNum,pageSize);

        List<UserMyMessageModel> userMyInfo = userMyMessageMapper.getUserMyMessage(userId,appointorName,startTime,endTime, pageNum, pageSize,title);

         return new PageInfo<>(userMyInfo);
    }

}